
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.html" />
    
    
    <link rel="prev" href="1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="1.html">
            
                <a href="1.html">
            
                    
                    2
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="2.html">
            
                <a href="2.html">
            
                    
                    3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="3.html">
            
                <a href="3.html">
            
                    
                    4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../2/1.html">
            
                <a href="../2/1.html">
            
                    
                    5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../3/1.html">
            
                <a href="../3/1.html">
            
                    
                    6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../4/1.html">
            
                <a href="../4/1.html">
            
                    
                    7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../5/1.html">
            
                <a href="../5/1.html">
            
                    
                    8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../6/1.html">
            
                <a href="../6/1.html">
            
                    
                    9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../7/1.html">
            
                <a href="../7/1.html">
            
                    
                    10
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <blockquote>
<p>&#x7B2C;01&#x9636;&#x6BB5;.&#x524D;&#x7AEF;&#x57FA;&#x7840;.CSS&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;</p>
<h1 id="css&#x9009;&#x62E9;&#x5668;&#xFF08;&#x91CD;&#x70B9;&#xFF09;">CSS&#x9009;&#x62E9;&#x5668;&#xFF08;&#x91CD;&#x70B9;&#xFF09;</h1>
</blockquote>
<p> &#x5B66;&#x4E60;&#x76EE;&#x6807;&#xFF1A;</p>
<ul>
<li>&#x7406;&#x89E3;<ul>
<li>&#x80FD;&#x8BF4;&#x51FA;&#x9009;&#x62E9;&#x5668;&#x7684;&#x4F5C;&#x7528;</li>
<li>id&#x9009;&#x62E9;&#x5668;&#x548C;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x7684;&#x533A;&#x522B;</li>
</ul>
</li>
<li>&#x5E94;&#x7528;<ul>
<li>&#x80FD;&#x591F;&#x4F7F;&#x7528;&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;&#x7ED9;&#x9875;&#x9762;&#x5143;&#x7D20;&#x6DFB;&#x52A0;&#x6837;&#x5F0F;</li>
</ul>
</li>
</ul>
<h2 id="1-css&#x9009;&#x62E9;&#x5668;&#x4F5C;&#x7528;&#xFF08;&#x91CD;&#x70B9;&#xFF09;">1. CSS&#x9009;&#x62E9;&#x5668;&#x4F5C;&#x7528;&#xFF08;&#x91CD;&#x70B9;&#xFF09;</h2>
<p>&#x5982;&#x4E0A;&#x56FE;&#x6240;&#x4EE5;&#xFF0C;&#x8981;&#x628A;&#x91CC;&#x9762;&#x7684;&#x5C0F;&#x9EC4;&#x4EBA;&#x5206;&#x4E3A;2&#x7EC4;&#xFF0C;&#x6700;&#x5FEB;&#x7684;&#x65B9;&#x6CD5;&#x600E;&#x529E;&#xFF1F;  </p>
<p>&#x5F88;&#x591A;&#xFF0C; &#x6BD4;&#x5982; &#x4E00;&#x53EA;&#x773C;&#x775B;&#x7684;&#x4E00;&#x7EC4;&#xFF0C;&#x5269;&#x4E0B;&#x7684;&#x4E00;&#x7EC4;  </p>
<h3 id="&#x9009;&#x62E9;&#x5668;&#x7684;&#x4F5C;&#x7528;">&#x9009;&#x62E9;&#x5668;&#x7684;&#x4F5C;&#x7528;</h3>
<p>&#x200B;    &#x627E;&#x5230;&#x7279;&#x5B9A;&#x7684;HTML&#x9875;&#x9762;&#x5143;&#x7D20;</p>
<p><strong>pink&#x8001;&#x5E08;&#x4E00;&#x53E5;&#x8BDD;&#x8BF4;&#x51FA;&#x4ED6;&#x4EEC;&#xFF1A; &#x203B;&#x203B;&#x203B;&#x203B;</strong></p>
<blockquote>
<p><strong>CSS&#x9009;&#x62E9;&#x5668;&#x5E72;&#x5565;&#x7684;&#xFF1F;   &#x9009;&#x62E9;&#x6807;&#x7B7E;&#x7528;&#x7684;&#xFF0C; &#x628A;&#x6211;&#x4EEC;&#x60F3;&#x8981;&#x7684;&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x51FA;&#x6765; </strong>  &#x5FC5;&#x987B;&#x8BB0;&#x4F4F;&#x7684;</p>
</blockquote>
<p>css &#x5C31;&#x662F; &#x5206;&#x4E24;&#x4EF6;&#x4E8B;&#xFF0C; &#x9009;&#x5BF9;&#x4EBA;&#xFF0C;  &#x505A;&#x5BF9;&#x4E8B;&#x3002; </p>
<pre><code class="lang-css"><span class="hljs-selector-tag">h3</span> { 
    <span class="hljs-attribute">color</span>: red;
}
</code></pre>
<p>&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x5C31;&#x662F;2&#x4EF6;&#x4E8B;&#xFF0C; &#x628A;  h3&#x9009;&#x51FA;&#x6765;&#xFF0C; &#x7136;&#x540E; &#x628A;&#x5B83;&#x53D8;&#x6210;&#x4E86; &#x7EA2;&#x8272;&#x3002; &#x4EE5;&#x540E;&#x6211;&#x4EEC;&#x90FD;&#x8FD9;&#x4E48;&#x5E72;&#x3002;</p>
<p>&#x9009;&#x62E9;&#x5668;&#x5206;&#x4E3A;&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;&#x548C; &#x590D;&#x5408;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x6211;&#x4EEC;&#x8FD9;&#x91CC;&#x5148;&#x8BB2;&#x89E3;&#x4E00;&#x4E0B; &#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;&#x3002;</p>
<h2 id="2-css&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;">2. CSS&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;</h2>
<h3 id="21-&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;">2.1 &#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li><p>&#x6982;&#x5FF5;&#xFF1A;</p>
<p>&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;&#xFF08;&#x5143;&#x7D20;&#x9009;&#x62E9;&#x5668;&#xFF09;&#x662F;&#x6307;&#x7528;<strong>HTML&#x6807;&#x7B7E;&#x540D;</strong>&#x79F0;&#x4F5C;&#x4E3A;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x6309;&#x6807;&#x7B7E;&#x540D;&#x79F0;&#x5206;&#x7C7B;&#xFF0C;&#x4E3A;&#x9875;&#x9762;&#x4E2D;&#x67D0;&#x4E00;&#x7C7B;&#x6807;&#x7B7E;&#x6307;&#x5B9A;&#x7EDF;&#x4E00;&#x7684;CSS&#x6837;&#x5F0F;&#x3002;</p>
</li>
<li><p>&#x8BED;&#x6CD5;&#xFF1A;</p>
</li>
</ul>
<pre><code>&#x6807;&#x7B7E;&#x540D;{&#x5C5E;&#x6027;1:&#x5C5E;&#x6027;&#x503C;1; &#x5C5E;&#x6027;2:&#x5C5E;&#x6027;&#x503C;2; &#x5C5E;&#x6027;3:&#x5C5E;&#x6027;&#x503C;3; }
</code></pre><ul>
<li><p>&#x4F5C;&#x7528;&#xFF1A;</p>
<p>&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668; &#x53EF;&#x4EE5;&#x628A;&#x67D0;&#x4E00;&#x7C7B;&#x6807;&#x7B7E;<strong>&#x5168;&#x90E8;</strong>&#x9009;&#x62E9;&#x51FA;&#x6765;  &#x6BD4;&#x5982;&#x6240;&#x6709;&#x7684;div&#x6807;&#x7B7E;  &#x548C; &#x6240;&#x6709;&#x7684; span&#x6807;&#x7B7E;</p>
</li>
<li><p>&#x4F18;&#x70B9;&#xFF1A;</p>
<p>&#x662F;&#x80FD;&#x5FEB;&#x901F;&#x4E3A;&#x9875;&#x9762;&#x4E2D;&#x540C;&#x7C7B;&#x578B;&#x7684;&#x6807;&#x7B7E;&#x7EDF;&#x4E00;&#x6837;&#x5F0F;</p>
</li>
<li><p>&#x7F3A;&#x70B9;&#xFF1A;</p>
<p>&#x4E0D;&#x80FD;&#x8BBE;&#x8BA1;&#x5DEE;&#x5F02;&#x5316;&#x6837;&#x5F0F;&#x3002;</p>
</li>
</ul>
<p><strong>&#x603B;&#x7ED3; &#x53E3;&#x8BC0;&#xFF1A;</strong></p>
<p>   &#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;&#xFF0C;
   &#x9875;&#x9762;&#x540C;&#x9009;&#x8D77;&#x3002;
   &#x76F4;&#x63A5;&#x5199;&#x6807;&#x7B7E;&#xFF0C;
   &#x5168;&#x90E8;&#x4E0D;&#x653E;&#x5F03;&#x3002;</p>
<pre><code>&#x601D;&#x8003;&#xFF1A; &#x5982;&#x679C;&#x60F3;&#x8981;&#x5DEE;&#x5F02;&#x5316;&#x9009;&#x62E9;&#x4E0D;&#x540C;&#x7684;&#x6807;&#x7B7E;&#xFF0C;&#x600E;&#x4E48;&#x529E;&#x5462;&#xFF1F; &#x5C31;&#x662F;&#x8BF4; &#x6211;&#x60F3;&#x5355;&#x72EC;&#x9009;&#x4E00;&#x4E2A;&#x6216;&#x8005;&#x67D0;&#x51E0;&#x4E2A;&#x6807;&#x7B7E;&#x5462;&#xFF1F;
</code></pre><h3 id="22-&#x7C7B;&#x9009;&#x62E9;&#x5668;">2.2 &#x7C7B;&#x9009;&#x62E9;&#x5668;</h3>
<p>&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x4F7F;&#x7528;&#x201C;.&#x201D;&#xFF08;&#x82F1;&#x6587;&#x70B9;&#x53F7;&#xFF09;&#x8FDB;&#x884C;&#x6807;&#x8BC6;&#xFF0C;&#x540E;&#x9762;&#x7D27;&#x8DDF;&#x7C7B;&#x540D;.</p>
<ul>
<li><p>&#x8BED;&#x6CD5;&#xFF1A;</p>
<ul>
<li>&#x7C7B;&#x540D;&#x9009;&#x62E9;&#x5668;</li>
</ul>
<pre><code>.&#x7C7B;&#x540D;  {   
    &#x5C5E;&#x6027;1:&#x5C5E;&#x6027;&#x503C;1; 
    &#x5C5E;&#x6027;2:&#x5C5E;&#x6027;&#x503C;2; 
    &#x5C5E;&#x6027;3:&#x5C5E;&#x6027;&#x503C;3;     
}
</code></pre><ul>
<li>&#x6807;&#x7B7E;</li>
</ul>
<pre><code>&lt;p class=&apos;&#x7C7B;&#x540D;&apos;&gt;&lt;/p&gt;
</code></pre></li>
<li><p>&#x4F18;&#x70B9;&#xFF1A;</p>
<ul>
<li>&#x53EF;&#x4EE5;&#x4E3A;&#x5143;&#x7D20;&#x5BF9;&#x8C61;&#x5B9A;&#x4E49;&#x5355;&#x72EC;&#x6216;&#x76F8;&#x540C;&#x7684;&#x6837;&#x5F0F;&#x3002; &#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x6216;&#x8005;&#x591A;&#x4E2A;&#x6807;&#x7B7E; </li>
</ul>
</li>
<li><p>&#x6CE8;&#x610F;</p>
<ul>
<li>&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x4F7F;&#x7528;&#x201C;.&#x201D;&#xFF08;&#x82F1;&#x6587;&#x70B9;&#x53F7;&#xFF09;&#x8FDB;&#x884C;&#x6807;&#x8BC6;&#xFF0C;&#x540E;&#x9762;&#x7D27;&#x8DDF;&#x7C7B;&#x540D;(&#x81EA;&#x5B9A;&#x4E49;&#xFF0C;&#x6211;&#x4EEC;&#x81EA;&#x5DF1;&#x547D;&#x540D;&#x7684;)</li>
<li>&#x957F;&#x540D;&#x79F0;&#x6216;&#x8BCD;&#x7EC4;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E2D;&#x6A2A;&#x7EBF;&#x6765;&#x4E3A;&#x9009;&#x62E9;&#x5668;&#x547D;&#x540D;&#x3002;</li>
<li>&#x4E0D;&#x8981;&#x7EAF;&#x6570;&#x5B57;&#x3001;&#x4E2D;&#x6587;&#x7B49;&#x547D;&#x540D;&#xFF0C; &#x5C3D;&#x91CF;&#x4F7F;&#x7528;&#x82F1;&#x6587;&#x5B57;&#x6BCD;&#x6765;&#x8868;&#x793A;&#x3002;</li>
</ul>
</li>
</ul>
<p>&#x547D;&#x540D;&#x89C4;&#x8303;&#xFF1A;  &#x89C1;&#x9644;&#x4EF6;&#xFF08;Web&#x524D;&#x7AEF;&#x5F00;&#x53D1;&#x89C4;&#x8303;&#x624B;&#x518C;.doc&#xFF09;</p>
<p>&#x547D;&#x540D;&#x662F;&#x6211;&#x4EEC;&#x901A;&#x4FD7;&#x7EA6;&#x5B9A;&#x7684;&#xFF0C;&#x4F46;&#x662F;&#x6CA1;&#x6709;&#x89C4;&#x5B9A;&#x5FC5;&#x987B;&#x7528;&#x8FD9;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x547D;&#x540D;&#x3002;</p>
<ul>
<li><p><strong>&#x8BB0;&#x5FC6;&#x53E3;&#x8BC0;</strong></p>
<p>&#x5DEE;&#x5F02;&#x5316;&#x9009;&#x62E9;
&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;
&#x4E0A;&#x9762;&#x70B9;&#x5B9A;&#x4E49;
&#x7C7B;&#x540D;&#x522B;&#x5199;&#x9519;
&#x8C01;&#x7528;&#x8C01;&#x8C03;&#x7528;
class&#x6765;&#x505A;&#x3002;</p>
<p>&#x563F;&#x563F;&#xFF0C;&#x5DE5;&#x4F5C;&#x7C7B;&#x6700;&#x591A;&#x3002;</p>
</li>
</ul>
<p><strong>&#x8BFE;&#x5802;&#x6848;&#x4F8B;&#xFF1A;</strong></p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">&quot;utf-8&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">

        <span class="hljs-selector-class">.blue</span> {
            <span class="hljs-attribute">color</span>: blue;
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">100px</span>;
        }
        <span class="hljs-selector-class">.red</span> {
            <span class="hljs-attribute">color</span>: red;
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">100px</span>;
        }
        <span class="hljs-selector-class">.orange</span> {
            <span class="hljs-attribute">color</span>: orange;
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">100px</span>;
        }
        <span class="hljs-selector-class">.green</span> {
            <span class="hljs-attribute">color</span>: green;
            <span class="hljs-attribute">font-size</span>: <span class="hljs-number">100px</span>;
        }
        </span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;blue&quot;</span>&gt;</span>G<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;red&quot;</span>&gt;</span>o<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;orange&quot;</span>&gt;</span>o<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;blue&quot;</span>&gt;</span>g<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;green&quot;</span>&gt;</span>l<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;red&quot;</span>&gt;</span>e<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<h3 id="23-&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x7279;&#x6B8A;&#x7528;&#x6CD5;--&#x591A;&#x7C7B;&#x540D;">2.3 &#x7C7B;&#x9009;&#x62E9;&#x5668;&#x7279;&#x6B8A;&#x7528;&#x6CD5;- &#x591A;&#x7C7B;&#x540D;</h3>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x7ED9;&#x6807;&#x7B7E;&#x6307;&#x5B9A;&#x591A;&#x4E2A;&#x7C7B;&#x540D;&#xFF0C;&#x4ECE;&#x800C;&#x8FBE;&#x5230;&#x66F4;&#x591A;&#x7684;&#x9009;&#x62E9;&#x76EE;&#x7684;&#x3002;</p>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<ul>
<li>&#x5404;&#x4E2A;&#x7C7B;&#x540D;&#x4E2D;&#x95F4;&#x7528;&#x7A7A;&#x683C;&#x9694;&#x5F00;&#x3002;</li>
<li>&#x591A;&#x7C7B;&#x540D;&#x9009;&#x62E9;&#x5668;&#x5728;&#x540E;&#x671F;&#x5E03;&#x5C40;&#x6BD4;&#x8F83;&#x590D;&#x6742;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x8FD8;&#x662F;&#x8F83;&#x591A;&#x4F7F;&#x7528;&#x7684;&#x3002;</li>
</ul>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;pink fontWeight font20&quot;</span>&gt;</span>&#x4E9A;&#x745F;<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;font20&quot;</span>&gt;</span>&#x5218;&#x5907;<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;font14 pink&quot;</span>&gt;</span>&#x5B89;&#x5176;&#x62C9;<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;font14&quot;</span>&gt;</span>&#x8C82;&#x8749;<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<h3 id="24-id&#x9009;&#x62E9;&#x5668;">2.4 id&#x9009;&#x62E9;&#x5668;</h3>
<p>id&#x9009;&#x62E9;&#x5668;&#x4F7F;&#x7528;<code>#</code>&#x8FDB;&#x884C;&#x6807;&#x8BC6;&#xFF0C;&#x540E;&#x9762;&#x7D27;&#x8DDF;id&#x540D;</p>
<ul>
<li><p>&#x5176;&#x57FA;&#x672C;&#x8BED;&#x6CD5;&#x683C;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;</p>
<ul>
<li><p>id&#x9009;&#x62E9;&#x5668;</p>
<pre><code>#id&#x540D; {&#x5C5E;&#x6027;1:&#x5C5E;&#x6027;&#x503C;1; &#x5C5E;&#x6027;2:&#x5C5E;&#x6027;&#x503C;2; &#x5C5E;&#x6027;3:&#x5C5E;&#x6027;&#x503C;3; }
</code></pre></li>
<li><p>&#x6807;&#x7B7E;</p>
<pre><code>&lt;p id=&quot;id&#x540D;&quot;&gt;&lt;/p&gt;
</code></pre></li>
</ul>
</li>
<li><p>&#x5143;&#x7D20;&#x7684;id&#x503C;&#x662F;&#x552F;&#x4E00;&#x7684;&#xFF0C;&#x53EA;&#x80FD;&#x5BF9;&#x5E94;&#x4E8E;&#x6587;&#x6863;&#x4E2D;&#x67D0;&#x4E00;&#x4E2A;&#x5177;&#x4F53;&#x7684;&#x5143;&#x7D20;&#x3002;</p>
</li>
<li><p>&#x7528;&#x6CD5;&#x57FA;&#x672C;&#x548C;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x76F8;&#x540C;&#x3002;</p>
</li>
</ul>
<h4 id="id&#x9009;&#x62E9;&#x5668;&#x548C;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x533A;&#x522B;">id&#x9009;&#x62E9;&#x5668;&#x548C;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x533A;&#x522B;</h4>
<ul>
<li>W3C&#x6807;&#x51C6;&#x89C4;&#x5B9A;&#xFF0C;&#x5728;&#x540C;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x5185;&#xFF0C;&#x4E0D;&#x5141;&#x8BB8;&#x6709;&#x76F8;&#x540C;&#x540D;&#x5B57;&#x7684;id&#x5BF9;&#x8C61;&#x51FA;&#x73B0;&#xFF0C;&#x4F46;&#x662F;&#x5141;&#x8BB8;&#x76F8;&#x540C;&#x540D;&#x5B57;&#x7684;class&#x3002;<ul>
<li>&#x7C7B;&#x9009;&#x62E9;&#x5668;&#xFF08;class&#xFF09; &#x597D;&#x6BD4;&#x4EBA;&#x7684;&#x540D;&#x5B57;&#xFF0C;  &#x662F;&#x53EF;&#x4EE5;&#x591A;&#x6B21;&#x91CD;&#x590D;&#x4F7F;&#x7528;&#x7684;&#xFF0C; &#x6BD4;&#x5982;  &#x5F20;&#x4F1F;  &#x738B;&#x4F1F;  &#x674E;&#x4F1F;  &#x674E;&#x5A1C;</li>
<li>id&#x9009;&#x62E9;&#x5668;     &#x597D;&#x6BD4;&#x4EBA;&#x7684;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#xFF0C;  &#x5168;&#x4E2D;&#x56FD;&#x662F;&#x552F;&#x4E00;&#x7684;&#xFF0C; &#x4E0D;&#x5F97;&#x91CD;&#x590D;&#x3002; &#x53EA;&#x80FD;&#x4F7F;&#x7528;&#x4E00;&#x6B21;&#x3002;</li>
</ul>
</li>
</ul>
<p><strong><em>id&#x9009;&#x62E9;&#x5668;&#x548C;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x6700;&#x5927;&#x7684;&#x4E0D;&#x540C;&#x5728;&#x4E8E; &#x4F7F;&#x7528;&#x6B21;&#x6570;&#x4E0A;&#x3002;</em></strong></p>
<p><strong>pink&#x8001;&#x5E08; &#x603B;&#x7ED3;&#x4ED6;&#x4EEC;</strong></p>
<ul>
<li>&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x6211;&#x4EEC;&#x5728;&#x4FEE;&#x6539;&#x6837;&#x5F0F;&#x4E2D;&#xFF0C;&#x7528;&#x7684;&#x6700;&#x591A;&#x3002;</li>
<li>id&#x9009;&#x62E9;&#x5668;&#x4E00;&#x822C;&#x7528;&#x4E8E;&#x9875;&#x9762;&#x552F;&#x4E00;&#x6027;&#x7684;&#x5143;&#x7D20;&#x8EAB;&#x4E0A;&#xFF0C;&#x7ECF;&#x5E38;&#x548C;&#x6211;&#x4EEC;&#x540E;&#x9762;&#x5B66;&#x4E60;&#x7684;javascript &#x642D;&#x914D;&#x4F7F;&#x7528;&#x3002;</li>
</ul>
<h3 id="26-&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;">2.6 &#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li><p>&#x6982;&#x5FF5;</p>
<p>&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;&#x7528;<code>*</code>&#x53F7;&#x8868;&#x793A;&#xFF0C;  *   &#x5C31;&#x662F; &#x9009;&#x62E9;&#x6240;&#x6709;&#x7684;&#x6807;&#x7B7E;      &#x4ED6;&#x662F;&#x6240;&#x6709;&#x9009;&#x62E9;&#x5668;&#x4E2D;&#x4F5C;&#x7528;&#x8303;&#x56F4;&#x6700;&#x5E7F;&#x7684;&#xFF0C;&#x80FD;&#x5339;&#x914D;&#x9875;&#x9762;&#x4E2D;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#x3002;</p>
</li>
<li><p>&#x5176;&#x57FA;&#x672C;&#x8BED;&#x6CD5;&#x683C;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;</p>
</li>
</ul>
<pre><code>* { &#x5C5E;&#x6027;1:&#x5C5E;&#x6027;&#x503C;1; &#x5C5E;&#x6027;2:&#x5C5E;&#x6027;&#x503C;2; &#x5C5E;&#x6027;3:&#x5C5E;&#x6027;&#x503C;3; }
</code></pre><p>&#x4F8B;&#x5982;&#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x4F7F;&#x7528;&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;&#x5B9A;&#x4E49;CSS&#x6837;&#x5F0F;&#xFF0C;&#x6E05;&#x9664;&#x6240;&#x6709;HTML&#x6807;&#x8BB0;&#x7684;&#x9ED8;&#x8BA4;&#x8FB9;&#x8DDD;&#x3002;</p>
<pre><code class="lang-css">* {
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">0</span>;                    <span class="hljs-comment">/* &#x5B9A;&#x4E49;&#x5916;&#x8FB9;&#x8DDD;*/</span>
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">0</span>;                   <span class="hljs-comment">/* &#x5B9A;&#x4E49;&#x5185;&#x8FB9;&#x8DDD;*/</span>
}
</code></pre>
<ul>
<li><p>&#x6CE8;&#x610F;&#xFF1A;</p>
<pre><code>  &#x4F1A;&#x5339;&#x914D;&#x9875;&#x9762;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#xFF0C;&#x964D;&#x4F4E;&#x9875;&#x9762;&#x54CD;&#x5E94;&#x901F;&#x5EA6;&#xFF0C;&#x4E0D;&#x5EFA;&#x8BAE;&#x968F;&#x4FBF;&#x4F7F;&#x7528;
</code></pre></li>
</ul>
<h3 id="27-&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;&#x603B;&#x7ED3;">2.7 &#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;&#x603B;&#x7ED3;</h3>
<table>
<thead>
<tr>
<th>&#x9009;&#x62E9;&#x5668;</th>
<th>&#x4F5C;&#x7528;</th>
<th>&#x7F3A;&#x70B9;</th>
<th>&#x4F7F;&#x7528;&#x60C5;&#x51B5;</th>
<th>&#x7528;&#x6CD5;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668;</td>
<td>&#x53EF;&#x4EE5;&#x9009;&#x51FA;&#x6240;&#x6709;&#x76F8;&#x540C;&#x7684;&#x6807;&#x7B7E;&#xFF0C;&#x6BD4;&#x5982;p</td>
<td>&#x4E0D;&#x80FD;&#x5DEE;&#x5F02;&#x5316;&#x9009;&#x62E9;</td>
<td>&#x8F83;&#x591A;</td>
<td>p { color&#xFF1A;red;}</td>
</tr>
<tr>
<td>&#x7C7B;&#x9009;&#x62E9;&#x5668;</td>
<td>&#x53EF;&#x4EE5;&#x9009;&#x51FA;1&#x4E2A;&#x6216;&#x8005;&#x591A;&#x4E2A;&#x6807;&#x7B7E;</td>
<td>&#x53EF;&#x4EE5;&#x6839;&#x636E;&#x9700;&#x6C42;&#x9009;&#x62E9;</td>
<td>&#x975E;&#x5E38;&#x591A;</td>
<td>.nav { color: red; }</td>
</tr>
<tr>
<td>id&#x9009;&#x62E9;&#x5668;</td>
<td>&#x4E00;&#x6B21;&#x53EA;&#x80FD;&#x9009;&#x62E9;&#x5668;1&#x4E2A;&#x6807;&#x7B7E;</td>
<td>&#x53EA;&#x80FD;&#x4F7F;&#x7528;&#x4E00;&#x6B21;</td>
<td>&#x4E0D;&#x63A8;&#x8350;&#x4F7F;&#x7528;</td>
<td>#nav {color: red;}</td>
</tr>
<tr>
<td>&#x901A;&#x914D;&#x7B26;&#x9009;&#x62E9;&#x5668;</td>
<td>&#x9009;&#x62E9;&#x6240;&#x6709;&#x7684;&#x6807;&#x7B7E;</td>
<td>&#x9009;&#x62E9;&#x7684;&#x592A;&#x591A;&#xFF0C;&#x6709;&#x90E8;&#x5206;&#x4E0D;&#x9700;&#x8981;</td>
<td>&#x4E0D;&#x63A8;&#x8350;&#x4F7F;&#x7528;</td>
<td>* {color: red;}</td>
</tr>
</tbody>
</table>
<p>&#x57FA;&#x7840;&#x9009;&#x62E9;&#x5668;&#x6211;&#x4EEC;&#x4E00;&#x5171;&#x5B66;&#x4E86;4&#x4E2A;&#xFF0C;  &#x6BCF;&#x4E2A;&#x90FD;&#x6709;&#x81EA;&#x5DF1;&#x7684;&#x4EF7;&#x503C;&#xFF0C; &#x53EF;&#x80FD;&#x518D;&#x67D0;&#x4E2A;&#x5730;&#x65B9;&#x90FD;&#x80FD;&#x7528;&#x5230;&#x3002;&#x4F46;&#x662F;&#x5982;&#x679C;&#x8BF4;&#xFF0C;&#x4E00;&#x5B9A;&#x8981;&#x627E;&#x4E2A;&#x6700;&#x5E38;&#x7528;&#x7684;&#xFF0C;&#x90A3;&#x4E48;&#xFF0C;&#x80AF;&#x5B9A;&#x662F;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x3002;</p>
<h3 id="28-&#x56E2;&#x961F;&#x7EA6;&#x5B9A;">2.8 &#x56E2;&#x961F;&#x7EA6;&#x5B9A;</h3>
<p>&#x9009;&#x62E9;&#x5668;</p>
<ul>
<li>&#x5C3D;&#x91CF;&#x5C11;&#x7528;&#x901A;&#x7528;&#x9009;&#x62E9;&#x5668; <code>*</code></li>
<li>&#x5C3D;&#x91CF;&#x5C11;&#x7528; ID &#x9009;&#x62E9;&#x5668;</li>
<li>&#x4E0D;&#x4F7F;&#x7528;&#x65E0;&#x5177;&#x4F53;&#x8BED;&#x4E49;&#x5B9A;&#x4E49;&#x7684;&#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668; div span </li>
</ul>
<pre><code>/* &#x63A8;&#x8350; */
.jdc {}
li {}
p{}

/* &#x4E0D;&#x63A8;&#x8350; */
*{}
#jdc {}
div{}   &#x56E0;&#x4E3A;div &#x6CA1;&#x6709;&#x8BED;&#x4E49;&#xFF0C;&#x6211;&#x4EEC;&#x5C3D;&#x91CF;&#x5C11;&#x7528;
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="1.html" class="navigation navigation-prev " aria-label="Previous page: 2">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="3.html" class="navigation navigation-next " aria-label="Next page: 4">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3","level":"1.3","depth":1,"next":{"title":"4","level":"1.4","depth":1,"path":"1/3.md","ref":"1/3.md","articles":[]},"previous":{"title":"2","level":"1.2","depth":1,"path":"1/1.md","ref":"1/1.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"1/2.md","mtime":"2020-11-12T14:04:48.165Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-11-12T14:12:15.513Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

